home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 2,801 to 2,900 / aol-file-protocol-4400-2801-to-2900.zip / AOLDLs / C++ Files Library / SK (Sockects) 1.4.1 r2 / SK v1.4.1 r2.sit / SK 1.4.1 r2 / SK / README.note < prev    next >
Text File  |  1994-06-17  |  20KB  |  472 lines

  1.                                     SK
  2.                                     --
  3.                                    
  4.                           BSD Sockets interface
  5.                              to TCP and UCP
  6.                             on the Macintosh
  7.                             
  8.                          Release version 1.4.1r2
  9.                       
  10.  
  11. NOTES
  12.  
  13. This code was derived from Matthias Neeracher's GUSI source code and ported
  14. to Semantec C++ 7.0.  This subset of GUSI supports only TCP & UDP
  15. style sockets, contains various "adjustments" for simplicity and/or to suit
  16. our needs.
  17.  
  18. This package is kept up to date with GUSI as that system evolves; the 
  19. current GUSI equivalent version is 1.4.1 (I will keep version numbers
  20. parallel to avoid confusion).
  21.  
  22. This subset was derived and is maintained by Stephan Deibel:
  23.  
  24. Decision Systems Group
  25. Brigham & Women's Hospital
  26. 75 Francis Street
  27. Boston, MA 02115
  28.  
  29. sdeibel@dsg.harvard.edu
  30.  
  31. The following is the adapted text of the original README file for 
  32. GUSI, minus sections that are now irrelevant:
  33.  
  34.  
  35. INTRODUCTION
  36.  
  37. SK is a BSD UNIX style Sockets interface to TCP and UDP on the Macintosh
  38. line of computers.
  39.  
  40.  
  41. REQUIREMENTS
  42.  
  43. To use SK, you need Symantec C++ 7.0 or later, a connection to internet
  44. and MacTCP properly configured to use valid DNS name servers.  System
  45. 7.0 may not be required, although I have not tested SK under systems
  46. older than 7.1.
  47.  
  48.  
  49. COPYING
  50.  
  51. Copyright ⌐ 1992-1994 Matthias Neeracher and the Decision Systems Group
  52.  
  53. Permission is granted to anyone to use this software for any purpose on
  54. any computer system, and to redistribute it freely, subject to the
  55. following restrictions:
  56.  
  57. 1) The authors and the Decision Systems Group are not responsible for 
  58.    the direct or indirect consequences of use of this software, no matter 
  59.    how awful, even if they arise from defects in the software itself.
  60.    This restriction applies to the use of this and any derived source code 
  61.    and also to the use of all binary produced from this and any derived 
  62.    source code.
  63. 2) The origin and copyrights of this software must not be misrepresented, 
  64.    either by explicit claim or by omission or alteration of copyright or
  65.    authorship header information in this file or in any derived file.
  66. 3) Altered or derived versions must be plainly marked as such, and must not
  67.    be misrepresented as being the original software.
  68.  
  69. We encourage users of this software to provide feedback, bug fixes,
  70. and enhancements to the authors for incorporation into future releases.
  71.  
  72. Please note:
  73.  
  74. This product includes software developed by the University of California, 
  75. Berkeley and its contributors.
  76.  
  77.  
  78. WHERE TO BEGIN
  79.  
  80. You should probably start with printing out the documentation in
  81. GUSI.ps.note and/or reading a book on the BSD sockets interface. Note that
  82. large portions of the original GUSI have been removed or altered, and
  83. that only TCP and UDP style sockets are support, so much of these
  84. documents will be irrelevant.
  85.  
  86. Some additional introductory materials and an FAQ can be found via 
  87. WWW starting at the following URL:
  88.  
  89. http://dsg.harvard.edu/public/software/SK/SK.html
  90.  
  91. An FAQ in text form is also included with this distribution.
  92.  
  93.  
  94. BUGS, QUESTIONS, SUGGESTIONS
  95.  
  96. Please report any problems you experience with the code or the
  97. documentation to Stephan Deibel.  I will forward bugs that may also appear
  98. in the real GUSI to Matthias Neeracher.  Please do NOT mail information
  99. directly to Matthias if you are working with SK.
  100.  
  101. Known bugs:
  102.  
  103. 0) Speed woes
  104.  
  105. Because of the way the Mac handles time slicing between processes,
  106. it isn't possible to get real sophisticated with yielding time
  107. slices during the default SPIN routine.  WaitNextEvent() accepts
  108. a "sleep time" that is in ticks (=1/60 sec).  A value of 0 ("a
  109. minimum amount" of time) is often too short and a value of 1 is usually 
  110. way too long (these short delays add up to alot).
  111.  
  112. This is primarily a problem when you have alot of messages shooting
  113. back and forth, since each message is delayed in processing by
  114. roughly 1/120 of a second (or more in many cases, it seems).  It
  115. gets even worse when both ends of a connection reside on the same
  116. Mac.
  117.  
  118. A benchmark using an RPC packaged layered on top of SK showed that
  119. tasks that were instantaneous (<1 sec) between two Sun workstations
  120. took 10 seconds when a Mac was involved on one end and 20 when a
  121. Mac was involved on both ends.
  122.  
  123. This can possibly be solved by storing the process number in the
  124. completion header and issuing a WakeUpProcess() call from all
  125. completion procedures.  Even this may fail to provide the performance
  126. one can expect under preemptive multitasking because, as far as I
  127. understand it, the completion procedures are called asyncronously
  128. as a result of processing that occurs during screen refresh.  If
  129. that is true, then the same overly long delay problem may still
  130. exist.
  131.  
  132. Since I am very interested in high performance on a Mac, I will be
  133. looking into this right after I prepare this release.
  134.  
  135. 1) UDP woes
  136.  
  137. [Probably fixed; this will be removed eventually when I am sure.]
  138.  
  139. Repeated calls to UDP socket ReadAhead() seem to cause all the parameter 
  140. blocks contained in CINETSocketDomain to be "used up".  Monitoring of 
  141. execution shows that the first few asynchronous ReadAhead() operations 
  142. performed on a UDP socket successfully complete with a call to the 
  143. appropriate completion procedure.  Then, calls seem to hang endlessly
  144. waiting for something to complete ((pb->ioResult == 1) in all of the 
  145. parameter blocks).
  146.  
  147. The symptom is generally endless hanging on the GetPB() call, which 
  148. normally would delay only until an additional parameter block is freed up.
  149. In one case, a diagnostic printf() seemed to "fix" the problem.  I
  150. suspecting a timing-related error but found that inserting a Delay()
  151. instead did not seem to work.
  152.  
  153. The cause of this bug is not known, although it may be due to a
  154. mistake made when porting, or possibly a bug in MacTCP.  I suspect
  155. memory corruption because of intermittent crashes after the bug
  156. appears, and the fact that insertion of a diagnostic printf() temporarily
  157. fixed the problem.
  158.  
  159. This bug was observed in the RPC package's sort_svc / rsort demo while 
  160. trying to obtain some performance data, so this problem may in fact lie
  161. in the RPC interface instead.
  162.  
  163. 2) Misc woes
  164.  
  165. Current GUSI equivalent version for this package is 1.4.1.  Patches
  166. made since that version to GUSI must at some point be applied to
  167. SK.  This is something that I do periodically, in cooperation with
  168. Matthias Neeracher.
  169.  
  170.  
  171. MAILING LIST
  172.  
  173. There is now a mailing list for announcing new releases and discussions
  174. about how to make GUSI change your life.  This may be of interest if you 
  175. also need to use socket types other than TCP and UDP and/or do not care 
  176. about portability of this code.  Also, Matthias has agreed to let SK
  177. users use this mailing list for the time being.  To subscribe, send mail to 
  178. <gusi-request@iis.ee.ethz.ch>
  179.  
  180. Matthias Neeracher                  Office: +41 1 632 51 46
  181. Hohenklingenstrasse 19              Home: +41 1 341 85 06
  182. 8049 Zuerich                        Email: <neeri@iis.ee.ethz.ch>
  183. SWITZERLAND
  184.  
  185.  
  186. RELEASE NOTES
  187.  
  188. Version 1.4.1r2 17Jun94
  189.  
  190. - Cleaned up the distribution to make it easier to use
  191. - Updated to latest MacTCP headers and dnr.c
  192. - Included all required headers with the distribution (everybody
  193.   else is doing it!)
  194. - Updated Q&A file, etc, accordingly
  195.  
  196. Version 1.4.1   25May94
  197.  
  198. - Applied all relevant changes and bug fixes from GUSI 1.1.1 through 1.4.1.
  199.   Also moved to Symantec C++ 7.0.
  200.  
  201. Version 0.5     24Mar94
  202.  
  203. - Minor updates to structure of distribution; prepared as pre-release
  204.   version of general use.
  205. - General testing & debugging has been performed.
  206.  
  207. Version 0.1     13Jul93
  208.  
  209. - Got everything to compile and link properly under Symantec C++ 6.0.  Not
  210.   yet tested.
  211.  
  212.  
  213. ------------------------- RELEASE NOTES FOR GUSI ------------------------------
  214.  
  215. Version 1.4.1   02May94
  216.  
  217. - Non-blocking sends on TCP sockets with large amounts of data would not do
  218.   anything [Benjamin Beberness].
  219.  
  220. Version 1.4.0   01May94
  221.  
  222. - Enabled recvfrom with non-NULL from addresses on all stream socket families
  223.   (returning getpeername()) to fix a problem with MacPerl [James Burgess, 
  224.   Asa Packer].
  225. - Attempting to write on half open sockets would still sometimes hang because of
  226.   the fflush() problem mentioned below. I had to extend the kludge to almost
  227.   all possible error codes [Asa Packer].
  228. - Permissions returned by stat() for locked files were wrong [John Kamp].
  229. - Implemented utime() as far as possible (i.e., for modification times, the
  230.   Mac has no concept of access times) [James Burgess].
  231. - Another round in my epic battle with rename(): This time, rename() resolved
  232.   aliases that should have been left unresolved [Maki Watanabe, Man Wei Tam].
  233. - Avoided calls to malloc() on system startup to circumvent problems with 
  234.   MacPerl memory allocation [Sal Gurnani, Torsten Ekedahl et al.].
  235. - Try to behave more sensibly when the other side closes a socket() 
  236.   [David Hansen].
  237. - getservbyname() would fail unless /etc/services was in the preferences folder
  238.   [Alasdair Rawsthorne].
  239. - Switched from Projector to RCS.
  240. - Tried to fix a compatibility problem with MPW 3.2
  241.  
  242. Version 1.3.6   22Feb94
  243.  
  244. - recvfrom wouldn't return the address of the sender [Michael Wu].
  245. - TFileSpec constructors now preserve case, (hopefully) making rename("a", "A")
  246.   finally work [Maki Watanabe].
  247. - rename() is now able to rename locked files. This is an experimental feature
  248.   introduced to support RCS. It might go away again.
  249.   
  250. Version 1.3.5      11Jan94
  251.  
  252. - Made the semantics of select() conform more closely to their UN*X counterparts.
  253.   In particular, if there is no more data to read/write, a socket is now flagged
  254.   as ready to read/write. In the past, the exception flag was incorrectly used 
  255.   to signal error conditions.
  256. - EBADF is now treated the same way as ESHUTDOWN on write().
  257. - GUSI now handles more than _NFILE stdio FILEs [James Tisdall].
  258. - Fixed several bugs with default arguments and prompts for choose() with files
  259.   [Maki Watanabe].
  260. - chdir() would ignore most errors [Peter Lewis].
  261.  
  262. Version 1.3.4      17Nov93
  263.  
  264. - Fixed a bug in GUSIBuffer which prevented PPC Toolbox sockets from receiving
  265.   more than about 2K of data before crashing.
  266. - fflush() in the MPW stdio library doesn't take no (or -1) for an answer, therefore
  267.   quitting with unsent data in the stdio buffers would cause programs to hang.
  268.   As a workaround, GUSI detects when write() is called twice in a row and 
  269.   ESHUTDOWN would have been returned both times. In this case, GUSI pretends
  270.   the write succeeded the second time.
  271. - The new version of rename introduced in 1.3.3 was buggy in several respects.
  272.   First of all, it would return EINVAL when the call actually had succeeded. 
  273.   Second, rename() was too naive to actually force the correct spelling.
  274.   rename("a", "A"), would work, rename("A", "A"), when the file was actually
  275.   spelled "a" would not.
  276. - rmdir() frivolously walked up a directory before deleting, which for some
  277.   strange reason sometimes actually worked.
  278. - readdir() would return ENOENT when the end of the directory was reached, which
  279.   is contrary to the way UN*X does it.
  280. - GUSI would try to open all network services whose socket families were linked 
  281.   in at a very early stage in the application. This would cause problems for 
  282.   SLIP/PPP (and probably also ARA) users, as for some applications (like MacPerl),
  283.   starting up SLIP every time made little sense. Additionally, initializing
  284.   MacTCP before the rest of the Toolbox would cause crashes with some SLIP 
  285.   implementations. The behaviour of GUSI has now changed so network services
  286.   are only initialized when the first socket is opened or another call necessitates
  287.   it.
  288. - A new socket family has been added in GUSIRemoteConole.o, which is currently not
  289.   documented, so using it is not recommended.
  290.  
  291. Version 1.3.3      24Oct93
  292.  
  293. - Added automatic centering to get directory dialog if rezzed for System 7 only.
  294. - Added a constructor for special files and folders to class TFileSpec.
  295. - Made rename("a", "A") possible.
  296. - Made TFileSpec and consequently GUSI file routines more robust against 
  297.   pathological paths. Path components longer than 63 chars used to trash 
  298.   memory.
  299.  
  300. Version 1.3.2      11Sep93
  301.  
  302. - In the absence of an /etc/services file, endservent() tried to fclose 
  303.   (FILE *) -1, with disastrous consequences. Thanks to Olafur Bragason for
  304.   reporting this bug.
  305. - Paul C. Aitkenhead discovered that accept() for TCP sockets didn't fill
  306.   in the name of the connecting peer. 
  307. - The tests will now initialize QuickDraw by themselves, to take into account
  308.   the fact that when using SIOW, WaitNextEvent might get called before SIOW has
  309.   a chance to initialize the Toolbox.
  310. - As Brad Pickering found out, sends for UDP sockets would by mistake never 
  311.   report errors.
  312.  
  313. Version 1.3.1   09Aug93
  314.  
  315. - Reid Simmons brought to my attention that gethostname() was no longer an
  316.   external symbol. On closer inspection, the same turned out to be true about 
  317.   truncate() and GUSIDefaultSpin(). I had made a few mistakes in my prototypes.
  318.   The new version of the Internalize script should catch this type of error in
  319.   the future.
  320.   
  321. Version 1.3.0      31Jul93
  322.  
  323. - Separated examples into their own folder with their own Makefile. Building
  324.   GUSITest will therefore no longer cause GUSI.o to be rebuilt.
  325. - The Makefile has been generally sanitized. 
  326. - All header files now reside in :includes
  327. - Most headers have changed in rather drastical ways. The BSD headers are now
  328.   taken from net2 and are prototyped. This is initially likely to produce a 
  329.   few errors in your code where typecasts have been missing. In particular, the
  330.   following have changed:
  331.    - bind, connect, accept, and getsockname take address parameters 
  332.         of type (struct sockaddr *).
  333.    - If you had declard any variables as (dirent *), you will have to change 
  334.         that to (struct dirent *).
  335. - The headers have also been adapted so that no symbol from the standard MPW headers
  336.   is ever redefined in an incompatible way (hopefully).
  337. - getserv...() has been enhanced, thanks to code contributed by Sak Wathanasin.
  338.   The new implementation first searches for a file /etc/services in the preferences
  339.   folder, before falling back on the old approach.
  340. - getservent(), setervent(), endservent(), getservbyport(), truncate(), ftruncate(),
  341.   and scandir() were added.
  342. - stat() on a directory now returns the number of files in st_size. Needless to
  343.   say, this is totally nonportable.
  344. - Pathnames where an intermediate folder existed as a file didn't give the
  345.   errors they should have given.
  346. - Another UDP fix.
  347.  
  348. Version 1.2.0      20Jun93
  349.  
  350. - Fixed a disastrous bug with configuration resources. MPW Tools that had no 
  351.   configuration resources would "borrow" resources of other Tools previously
  352.   loaded.
  353. - It is now possible to make the type & creator of newly created file dependent
  354.   on their suffixes (i.e., anything ening in .o can be mapped to 'OBJ '/'MPS ')
  355. - If socket creation fails due to low memory conditions, errno is set correctly
  356. - Opening of the console is now handled more subtly, allowing programmers to link
  357.   GUSI with their custom "Dev:Console" handlers.
  358. - The routine for checking for Command-period is now exported
  359. - getsockname() for UDP sockets in an early stage of their existence would in some
  360.   cases nonsense. Thanks to Paul C. Aitkenhead for discovering.
  361. - Changed sa_constr_ppc. The old version was basically unable to provide a real
  362.   constraint. Hopefully, though, old sa_constr_ppc records are still handled
  363.   correctly.
  364. - Bracketed all headers defining prototypes with #ifdef __cplusplus incantations.
  365.   Thanks to John W. Pope for suggesting this.
  366.   
  367. Version 1.1.1      04Apr93
  368.  
  369. - A few of the declarations in sys/fcntl.h were inconsistent with Fcntl.h and 
  370.   the actual behaviour of GUSI, in particular O_CREATE. (thanks to Franklin Chen 
  371.   for reporting).
  372. - PAP sockets would lose data when closed.
  373.  
  374. ---------- DERIVATION FROM ORIGINAL 1.1.0 release of GUSI --------------
  375.  
  376. Version 1.1.0            14Mar93
  377.  
  378. - Reorganized the way to specify parts of GUSI to include. There are no
  379.   specialized builds like GUSI_AFU.o anymore. Instead, you specify one or 
  380.   several configuration files in addition to GUSI.o in the link. If you 
  381.   just want to include everything possible, use 
  382.   {CLibraries}GUSI_Everything.cfg.
  383. - Added support for the Printer Access Protocol (PAP): You can open a
  384.   connection to the currently chosen LaserWriter with open("Dev:Printer").
  385. - Added support for Dave Peterson's forthcoming inetd.
  386. - Introduced fgetfileinfo().
  387. - All header files are now protected against multiple inclusion, as
  388.   suggested by J.T. Conklin.
  389. - st_nlink in statbufs used to return 1 for both files and folders. While
  390.   it might be argued that this is true, it breaks some Unix programs. 
  391.   Therefore, the current version returns for folders either the number 
  392.   of items the folder contains + 2 or the number of subdirectories the 
  393.   folder contains + 2 (the 2 is a Unixism), depending on a flag in the 
  394.   configuration resource (thanks to Charlie Reiman for reporting).
  395. - fstat() used to claim that sockets were regular files. This bug had
  396.   horrible consequences for some Unix software. Now, they correctly 
  397.   declare sockets to be such.
  398. - Use FSpMakeFSSpec at some places in TFileSpec if it's available. Added a
  399.   member function Bless() to guarantee the kosherness of a TFileSpec.
  400. - Found a few severe bugs in GUSIBuffer. PPC sockets might work better
  401.   now.
  402. - Added several new options to the preference resource. To specify which
  403.   version of the preference resource you want, #define GUSI_PREF_VERSION 
  404.   to the version you want. If you don't, version '0102' is assumed.
  405. - To faciliate changing flags on the fly, programs rezzed with GUSI.r now
  406.   include a TMPL for the version resource.
  407.  
  408. Version 1.0.2            24Jan93
  409.  
  410. - rename() used to sometimes do the wrong thing if both the name and the
  411.   folder had to be changed. I don't think the new version is 100% 
  412.   correct, but it should be better. (thanks to Brad Pickering for 
  413.   reporting)
  414. - choose() for files doesn't count the terminating NULL byte anymore. I
  415.   hope nobody relied on the old version. (thanks again to Brad Pickering)
  416. - getserv...() and getprotoby...() used to return NULL for the aliases
  417.   field, which is not correct.
  418. - TCP/IP sockets had a horrible bug with fast read/writes. That's what I
  419.   get for not doing my code stealing properly.
  420.  
  421. Version 1.0.1            09Jan93
  422.  
  423. - If a TCP socket returned from accept() was closed, further accepts on
  424.   the  parent socket were disabled. Fixed. Thanks to Chen JiaTyan for
  425.   reporting.
  426. - GUSI configuration resources are now respected
  427. - Programs linked with GUSI now by default automatically call the spin
  428.   routine for every read/write (This can be turned off in the configuration
  429.   resource).
  430. - Add a chdir()-respecting fsetfileinfo()
  431.  
  432. Version 1.0                20Dec92
  433.  
  434. - Changed the way subset libraries were built.
  435. - Arrange for the GUSI_F variant to be always built.
  436. - Add routines to access FSSpec manipulations from plain C.
  437. - Add correct prototypes to netdb.h.
  438. - Rename GUSIFSp_P.h to TFileSpec.h and make it public.
  439. - Let choose() treat flags consistently for all address families: If
  440.   CHOOSE_NEW or CHOOSE_DIR are specified for a family that doesn't 
  441.   support them, EINVAL is returned.
  442. - FileSocketDomain::choose() now treats CHOOSE_DEFAULT correctly
  443. - Add getcwd()
  444. - stat() now considers files with type 'TEXT' as executable (this is
  445.   certainly controversial and might be made configurable in a future 
  446.   version).
  447. - removed GUSIResident, the feature from hell. I forgot twice to specify
  448.   a resident segment for it, and both times it took me almost a week to
  449.   find the bug. The routines formerly in GUSIResident are now in Main.
  450. - fixed a few bugs.
  451. - Updated the documentation.
  452.  
  453. Version 1.0b4            29Oct92
  454.  
  455. Purged (hopefully) the last remaining traces of the obsolete structure
  456. name "direct" (should have been "dirent"). Thanks to Kevin Willey for 
  457. pointing out that bug.
  458.  
  459. Version 1.0b3            19Oct92
  460.  
  461. Fixed a few bugs in the test programs
  462.  
  463. Version 1.0b2            05Oct92
  464.         
  465. The documentation is now almost complete.
  466.  
  467. Version 1.0b1            28Sep92
  468.  
  469. This release is somewhat premature. Although I believe the code is already
  470. in a decent shape, the documentation is still in a bad shape. I wouldn't 
  471. trust the PPC Toolbox code too much yet.
  472.